package com.edfeff.bio.adapter;

import com.edfeff.bio.http.Constants;
import com.edfeff.bio.http.IAdapter;
import com.edfeff.bio.http.Request;
import com.edfeff.bio.http.Response;

/**
 * Echo 服务
 */
public class EchoAdapter implements IAdapter {
    @Override
    public void service(Request req, Response res) throws Exception {
        String reqStr = req.toString();
        res.setBody(reqStr.getBytes(Constants.charset));
        res.setContentType("text/plain");
    }
}
